package Main;
import commands.ToltalCommandUsesCommand;
import net.dv8tion.jda.JDA;
import net.dv8tion.jda.events.ReadyEvent;
import net.dv8tion.jda.events.message.MessageReceivedEvent;
import net.dv8tion.jda.hooks.ListenerAdapter;
public class BotListener extends ListenerAdapter{
	private static JDA jda;
	@Override
	public void onMessageReceived(MessageReceivedEvent event){
		if(event.getMessage().getContent().startsWith(">>") && event.getMessage().getAuthor().getId() != event.getJDA().getSelfInfo().getId()) Main.handleCommand(Main.parser.parse(event.getMessage().getContent().toLowerCase(),event));
		
		if(event.getMessage().getContent().toLowerCase().contains("tinyice") && event.getMessage().getAuthor().getId() != event.getJDA().getSelfInfo().getId()){
			ToltalCommandUsesCommand.countT ++;
			event.getTextChannel().sendMessage("Tiny is the creator of this bot. Here is his server! https://discord.gg/0xrFY3tlSVUeKuga");
	}
	
				}
		@Override
		public void onReady(ReadyEvent event){
		//	Main.log("status", "Logged in as : " + event.getJDA().getSelfInfo().getUsername());
		}
	}
	

